<!DOCTYPE html>
<html>
  <head>
    <title>Storage Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    //

    function inster(){
    	
    	var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
        db.transaction(inster_, errorCB, successCB);
    }
    
    function inster_(tx){
    	var t = document.getElementById("title").value;
    	var c =  document.getElementById("content").value;
    	tx.executeSql("INSERT INTO DEMO (title,content) VALUES ('"+t+"','"+c+"')");
    }
    
    // Transaction error callback
    //
    function errorCB(err) {
        console.log("Error processing SQL: "+err.code);
    }

    // Transaction success callback
    //
    function successCB() {
    	alert("successed");
        console.log("Success processing SQL: ");
    }

    </script>
  </head>
  <body>
    <h1>Example</h1>
    <a href="index.html">index</a>
    <p>Database - Add</p>
    
    Title:
    <input type="text" id="title"/>
    Content:
    <input type="text" id="content"/>
    <input type="submit" id="submit" value="submit" onclick="inster();"/>
    
    
  </body>
</html>